<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>可以给参数设置默认值</p>
    <script>
        function fn1(a=12, b='at') {
            console.log(arguments);
            return a + b
        }

        let res1 = fn1(8, `AT`);
        console.log(res1);
        let res2 = fn1();
        console.log(res2);

        // 函数的剩余参数--数量比较多 地位相同 而且放在最后
        function fn2(yeye, zsj, ...huluwas) {
            console.log(`种葫芦的是${yeye}，办坏事的是${zsj},剩下的一大堆是:${huluwas}`);
        }

        fn2('种树的', '钻山甲', '力大无穷', '千里眼', '顺风耳', '小金刚', '555', '隐身娃', '彩虹娃')
    </script>
</body>
</html>